/**
 * 
 */
package com.geezdata.cps.ttk.core.command;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.geezdata.cps.base.response.BaseResponse;
import com.geezdata.cps.cqrs.command.Command;
import com.geezdata.cps.ttk.common.request.UpdateSharerRequest;
import com.geezdata.cps.ttk.domain.domain.Sharer;
import com.geezdata.cps.ttk.mapper.mapper.SharerMapper;

/**
 * @author sszheng
 * @date 创建时间：2018年10月26日 下午3:30:03
 *
 */
@Service
public class UpdateSharerCommand implements Command<UpdateSharerRequest, Object>{
	@Autowired
	private SharerMapper sharerMapper;

	@Override
	@Transactional
	public BaseResponse<Object> execute(UpdateSharerRequest request) {
		Sharer entity = new Sharer();
		entity.setSharerId(request.getSharerId());
		entity.setIsHeader(request.getIsHeader());
		entity.setUpdatedUser(request.getCurrentUser());
		
		sharerMapper.updateByPrimaryKey(entity );
		return BaseResponse.success(null);
	}
}
